package com.websever.core;

import com.websever.Http.HttpServletRequest;

import java.io.IOException;
import java.io.InputStream;
import java.lang.management.GarbageCollectorMXBean;
import java.net.Socket;
import java.util.HashMap;
import java.util.Map;

/*
 线程任务
 负责与特定的客户端进行HTTP交互
 */
public class ClientHandler implements Runnable {
   private Socket socket;
   public ClientHandler(Socket socket){
       this.socket = socket;
   }

    public void run() {
        try {
           //解析请求
            HttpServletRequest request = new HttpServletRequest(socket);

            // 处理请求


            // 发送相应
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                //响应后断开连接
                socket.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } }


}
